{{define "content"}}
  <article class="grid">
    <div>
      <hgroup>
        <h2>Following</h2>
        <h3>
          {{ if $.User.Is .Profile.URL }}
            List of users and feeds you are following
          {{ else }}
            List of users and feeds <b>{{ .Profile.Username }}</b> is following
          {{ end }}
        </h3>
      </hgroup>
      {{ if .Profile.Following }}
        <ol>
          {{ range $Nick, $URL := .Profile.Following }}
            <li>
              {{ if isLocalURL $URL }}
                <a href="{{ $URL | trimSuffix "/twtxt.txt" }}">
              {{ else }}
                <a href="/external?uri={{ $URL }}&nick={{ $Nick  }}">
              {{ end }}
              {{ if $.User.Is $URL }}me{{ else }}{{ $Nick }}{{ end }}

              {{ if $.Authenticated }}
                {{ if not ($.User.Is $URL) }}
                  {{ if $.User.Follows $URL }}
                    [<a href="/unfollow?nick={{ $Nick }}">Unfollow</a>]
                  {{ else }}
                    [<a href="/follow?nick={{ $Nick }}&url={{ $URL }}">Follow</a>]
                  {{ end }}
                {{ end }}
              {{ end }}
            </li>
          {{ end }}
        </oL>
      {{ else }}
        <small>
          {{ if $.User.Is .Profile.URL }}
            You are not following any users or feeds!
            <a href="/follow">Follow</a> someone or <a href="/discover">discover</a>
            new users or interesting <a href="/feeds">feeds</a> on {{ .InstanceName }}.
          {{ else }}
            <b>{{ .Profile.Username }}</b> is not following any users or feeds.</i>
          {{ end }}
        </small>
      {{ end }}
    </div>
  </article>
{{ end }}
